<?php defined('_JEXEC') or die('Restricted access'); ?>

<form action="index.php" method="post" name="adminForm" id="adminForm" >

<table border="0" width="100%">
	<tr>
		<td align="right">
		    <?php echo $this->lists['state']; ?>
			<?php echo $this->lists['catid']; ?>
		</td>
	</tr>
</table>

<table class="adminlist">
<thead>
	<tr>
		<th width="10">
			<?php echo JText::_( 'NUM' ); ?>
		</th>
		
		<th width="30">
			<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items ); ?>);" />
		</th>
		
		<th class="title" style="text-align: left;">
			<?php echo JHTML::_('grid.sort', JText::_( 'AUTHOR' ), 'author', $this->lists['order_Dir'], $this->lists['order'] ); ?>
		</th>
		
		<th class="title" style="text-align: left;">
			<?php echo JHTML::_('grid.sort', JText::_( 'RATING' ), 'rating', $this->lists['order_Dir'], $this->lists['order'] ); ?>
		</th>
		
		<th class="title" style="text-align: left;">
			<?php echo JText::_( 'IMAGE' ); ?>
		</th>
		
		<th class="title" style="text-align: left;">
			<?php echo JHTML::_('grid.sort', JText::_( 'CATEGORY' ), 'gallery_id', $this->lists['order_Dir'], $this->lists['order'] ); ?>
		</th>
		
		
		<th class="title" style="text-align: left;">
			<?php echo JHTML::_('grid.sort', JText::_( 'IP ADDRESS' ), 'ip', $this->lists['order_Dir'], $this->lists['order'] ); ?>
		</th>
		
		<th class="title" style="text-align: left;">
			<?php echo JHTML::_('grid.sort', JText::_( 'DATE' ), 'date', $this->lists['order_Dir'], $this->lists['order'] ); ?>
		</th>
		
		<th width="80" nowrap="nowrap">
			<?php echo JHTML::_('grid.sort', JText::_( 'PUBLISHED' ), 'published', $this->lists['order_Dir'], $this->lists['order'] ); ?>	
		</th>
		
	</tr>
</thead>	

<tfoot>
	<tr>
		<td colspan="9" align="center" style="text-align: center">
			<?php echo $this->pagination->getListFooter(); ?>
		</td>
	</tr>
</tfoot>

<?php
$k = 0;
$numberRatings = count($this->items);

for ($i=0; $i<$numberRatings; $i++)
{
	$row = &$this->items[$i];
	
	$checked = JHTML::_('grid.id', $i, $row->id);
	$published 	= JHTML::_('grid.published', $row, $i);	

	?>
	<tr class="<?php echo "row$k"; ?>">
		<td>
			<?php echo $this->pagination->getRowOffset($i); ?>
		</td>
		
		<td>
			<?php echo $checked; ?>
		</td>
	
		<td>
			<?php echo $row->author; ?>
		</td>
		
		<td>
			<?php
			for($m=0; $m<5; $m++)
			{
				if($m<$row->rating)
				{
					?>
					<img src="<?php echo IG_IMAGE_ASSET_PATH; ?>/star-blue.gif" alt="" />
					<?php
				}
				else 
				{
					?>
					<img src="<?php echo IG_IMAGE_ASSET_PATH; ?>/star-white.gif" alt="" />
					<?php
				}
			}
			?>
		</td>
		
		<td>
			<img src="<?php echo IG_IMAGE_HTML_RESIZE; ?><?php echo $this->thumbFiles[$i]['folderName']; ?>/<?php echo $this->thumbFiles[$i]['fullFileName']; ?>"
			width="<?php echo $this->thumbFiles[$i]['width']; ?>" height="<?php echo $this->thumbFiles[$i]['height'] ?>" alt="<?php echo $row->alt_text; ?>"/>
		</td>
		
		<td>
			<?php echo $row->name; ?>
		</td>
		
		<td>
			<?php echo $row->ip; ?>
		</td>
		
		<td>
			<?php echo date(" G:i j/m/Y",$row->date); ?>
		</td>
		
		<td align="center">
			<?php echo $published;?>
		</td>
		
		
	</tr>
	<?php
	$k = 1 - $k;
}
?>

</table>

<input type="hidden" name="option" value="com_igallery" />
<input type="hidden" name="controller" value="igrating" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
</form>

